<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>测试comet4j</title>
<script type="text/javascript" src="${ctxStatic}/comet4j/comet4j.js"></script>
<script type="text/javascript" >
function init(){
        var dom = document.getElementById('tt');
        JS.Engine.on({'notice' : function(text){	//侦听一个channel
                		console.log(text);
                		dom.innerHTML = text.content;
                }
        });
        
        JS.Engine.on('start',function(cId,channelList,engine){
      	  alert('连接已建立，连接ID为：' + cId);
        });
        
        JS.Engine.start('conn');
}
</script>
</head>
<body onload="init()">
	时间：<span id="tt">...</span>
</body>
</html>